package org.tgcloud.group.repository;

import org.apache.ibatis.annotations.Param;
import org.tgcloud.group.entity.MjProjectMedium;
import org.tgcloud.group.web.controller.dto.medium.MediumPackageList;
import org.tgcloud.group.web.controller.dto.medium.ProjectMediumAllList;
import org.tgcloud.group.web.controller.dto.medium.ProjectMediumCountDTO;
import org.tgcloud.group.web.controller.dto.medium.ProjectMediumListDTO;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author: zhy
 * @Created: 2025-07-08-下午3:41
 * @Description: ${description}
 */
public interface MjProjectMediumMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MjProjectMedium record);

    int insertSelective(MjProjectMedium record);

    MjProjectMedium selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MjProjectMedium record);

    int updateByPrimaryKey(MjProjectMedium record);

    List<ProjectMediumListDTO> selectListByProjectId(@Param("projectId") int projectId);

    MjProjectMedium selectLastAddIndexByProjectId(@Param("projectId") int projectId);

    List<MediumPackageList> selectPackageListByProjectId(@Param("projectId") int projectId);

    List<ProjectMediumListDTO> selectListByProjectIdAndIndexNum(@Param("projectId") int projectId, @Param("indexNum") int indexNum);

    List<ProjectMediumListDTO> selectExportListByProjectIdAndIndexNum(@Param("projectId") int projectId, @Param("indexNum") int indexNum);

    int updateStatusByAddIndexAndUserId(@Param("addIndex") Integer chooseAddIndex, @Param("projectId") int projectId);

    List<MjProjectMedium> selectListMsgByAddIndexAndUserIdAndProjectId(@Param("addIndex") Integer chooseAddIndex, @Param("projectId") int projectId);

    MjProjectMedium selectOneMsgByAddIndexAndUserIdAndProjectId(@Param("addIndex") Integer chooseAddIndex, @Param("projectId") int projectId);

    List<MjProjectMedium> selectMediumListByProjectIdAndAddIndex(@Param("projectId") int projectId, @Param("addIndex") Integer addIndex);

    int updateChooseTimeById(@Param("chooseId") Integer chooseId, @Param("chooseDate") Date chooseDate, @Param("chooseEndDate") Date chooseEndDate,
                             @Param("lineIndex") Integer lineIndex, @Param("areaType") Integer areaType);

    List<MjProjectMedium> getCheckListHasLimitNumByChooseDate(@Param("chooseDate") Date chooseDate, @Param("chooseEndDate") Date chooseEndDate,
                                                              @Param("lineId") Integer lineId, @Param("chooseId") Integer chooseId,
                                                              @Param("lineIndex") Integer lineIndex, @Param("areaType") Integer areaType);

    MjProjectMedium selectNoChooseTimeByAddIndexAndProjectIdAndLineId(@Param("addIndex") Integer addIndex, @Param("projectId") int projectId, @Param("lineId") int lineId);

    MjProjectMedium selectHasJoinByProjectId(@Param("projectId") int projectId);

    int updateChooseStatusByAddIndexAndProjectId(@Param("indexNum") int indexNum, @Param("projectId") int projectId);

    List<ProjectMediumCountDTO> selectProjectListByMediumId(@Param("mediumId") Integer id, @Param("projectIdList") String[] projectIdList,
                                                            @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    BigDecimal selectTotalGoodPriceByProjectId(@Param("projectId") Integer projectId);

    List<MjProjectMedium> selectTestList();

    List<ProjectMediumAllList> selectListByProjectIdAndLineType(@Param("projectId") int projectId, @Param("lineType") Short lineType);

    int updateUserTypeById(@Param("chooseId") Integer chooseId, @Param("sureType") Integer sureType);

    int updateDelById(@Param("id") int id);

    List<Integer> selectMediumIdListByLineTypeAndProjectIds(@Param("lineType") int lineType, @Param("projectIdList") String[] projectIdList);

    MjProjectMedium getCheckListHasLimitNumByChooseDateAndIndexAndAreaType(@Param("chooseDate") Date chooseDate, @Param("chooseEndDate") Date chooseEndDate,
                                                                           @Param("lineId") Integer lineId, @Param("chooseId") Integer chooseId,
                                                                           @Param("lineIndex") Integer lineIndex, @Param("areaType") Integer areaType);

    int updateUserIdById(@Param("id") Integer id, @Param("chooseUserId") Integer chooseUserId);
}